package org.ventura.sistemafinanciero.entity;

// Generated 02-may-2014 11:48:28 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.math.BigInteger;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 * Accionista generated by hbm2java
 */
@Entity
@Table(name = "ACCIONISTA", schema = "BDSISTEMAFINANCIERO")
@XmlRootElement(name = "accionista")
@XmlAccessorType(XmlAccessType.NONE)
public class Accionista implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private BigInteger idAccionista;

	@NotNull(message = "Persona natural is null")
	private PersonaNatural personaNatural;

	@NotNull(message = "Persona juridica is null")
	private PersonaJuridica personaJuridica;

	@NotNull(message = "Porcentaje participacion is null")
	private BigDecimal porcentajeParticipacion;

	public Accionista() {
	}

	public Accionista(BigInteger idAccionista, PersonaNatural personaNatural,
			PersonaJuridica personaJuridica, BigDecimal porcentajeParticipacion) {
		this.idAccionista = idAccionista;
		this.personaNatural = personaNatural;
		this.personaJuridica = personaJuridica;
		this.porcentajeParticipacion = porcentajeParticipacion;
	}

	@XmlElement(name = "id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Id
	@Column(name = "ID_ACCIONISTA", unique = true, nullable = false, precision = 22, scale = 0)
	public BigInteger getIdAccionista() {
		return this.idAccionista;
	}

	public void setIdAccionista(BigInteger idAccionista) {
		this.idAccionista = idAccionista;
	}

	@XmlElement
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_PERSONA_NATURAL", nullable = false)
	public PersonaNatural getPersonaNatural() {
		return this.personaNatural;
	}

	public void setPersonaNatural(PersonaNatural personaNatural) {
		this.personaNatural = personaNatural;
	}

	@XmlTransient
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_PERSONA_JURIDICA", nullable = false)
	public PersonaJuridica getPersonaJuridica() {
		return this.personaJuridica;
	}

	public void setPersonaJuridica(PersonaJuridica personaJuridica) {
		this.personaJuridica = personaJuridica;
	}

	@XmlElement
	@Column(name = "PORCENTAJE_PARTICIPACION", nullable = false, precision = 5)
	public BigDecimal getPorcentajeParticipacion() {
		return this.porcentajeParticipacion;
	}

	public void setPorcentajeParticipacion(BigDecimal porcentajeParticipacion) {
		this.porcentajeParticipacion = porcentajeParticipacion;
	}

}
